#include "connectionMgr.h"


ConnectionMgr::~ConnectionMgr()
{
    for(auto& con : _connections)
    {
        con.second->close();
    }
    _connections.clear();
}

void ConnectionMgr::add_connection(Connection::ptr conptr)
{
    _connections[conptr->uuid()] = conptr;
}
void ConnectionMgr::rmv_connection(std::string uuid)
{
    _connections.erase(uuid);
}

ConnectionMgr& ConnectionMgr::get_instance()
{
    static ConnectionMgr instance;
    return instance;
}


